package layers.ants;

import layers.agents.TruckAgent;
import layers.physical.Crossroad;
import layers.physical.Path;

public class ExplorationAnt extends HopAnt{
	
	public static final int INITIALHOPS = 5;
	private ExplorationAntState state;
	
	public ExplorationAnt(Crossroad crossroad, TruckAgent truckAgent, int amountOfHops, long traveledDistance, Path path){
		super(crossroad, truckAgent, path, amountOfHops, traveledDistance);	
		this.state = new ExplorationAntStateSearchingRoadsigns(this);
	}

	@Override
	public void processAntTick() {
		this.getState().processTick();
	}
	
	private ExplorationAntState getState() {
		return this.state;
	}

	protected void setState(ExplorationAntState state) {
		this.state = state;
	}

	public boolean isDying() {
		return this.getRemainingHops() == 0;
	}

	public void notifyTruck() {
		this.getState().notifyTruck();
	}
	
	protected void setCrossroad(Crossroad crossroad) {
		super.setCrossroad(crossroad);
		this.getPath().addCrossroadToPath(crossroad);
	}
}
